<div class="modal-header">
  <div class="modal-title">{{ record.id ? '编辑' : '新增' }}</div>
</div>
<nz-spin *ngIf="!i" class="modal-spin"></nz-spin>
<sf *ngIf="i" #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="i" button="none">
  <ng-template sf-template="qr" let-i let-options="options" let-ui="ui" let-schema="schema">
    <ng-codemirror [ngModel]="i.sql"></ng-codemirror>
  </ng-template>
  <div class="modal-footer">
    <button nz-button type="button" (click)="close()">关闭</button>
    <button nz-button type="submit" nzType="primary" (click)="save(sf.value)" [disabled]="!sf.valid" [nzLoading]="http.loading">
      保存
    </button>
    <button nz-button type="submit" nzType="primary" (click)="saveAs(sf.value)" [disabled]="!sf.valid" [nzLoading]="http.loading">
      另保存
    </button>
  </div>
</sf>
